<template>
  <div class="all">
    <div class="top">
      <img :src="item.user.avatar_url || defaultImg">
      <p>{{ item.user.nick_name }}</p>
      <van-rate
        :value="item.score / 2"
        :size="14"
        color="#ffd21e"
        void-icon="star"
        void-color="#eee"
      />
    </div>
    <div class="main">
      {{ item.content }}
    </div>
    <div class="footer">
      {{ item.create_time }}
    </div>
  </div>
</template>

<script>
import defaultImg from '@/assets/default-avatar.png'
export default {
  data () {
    return {
      defaultImg: defaultImg // 默认用户头像
    }
  },
  props: {
    item: Object
  }
}
</script>

<style scoped>
.all {
  height:100px;
  border-bottom:1px solid pink;
  display:flex;
  flex-direction:column;
  justify-content:space-evenly;
}
.top {
  display:flex;
  align-items:center;
}
.top p {
  font-size:12px;
  margin-right:5px;
}
.top img {
  width:15px;
  height:15px;
}
.footer {
  font-size:10px;
  opacity: 0.5;
}
</style>
